<script>
    layui.config({
        base: '/static/customAdmin/'
    }).extend({
        index: 'lib/index'
    }).use(['index', 'form', 'admin', 'rate', 'table', 'laytpl', 'upload'], async () => {
        const form = layui.form, admin = layui.admin, table = layui.table;
        //新建联系人
        form.on('submit(contacts_submit)', async (data) => {
            data.field.CompanyId = @{{.companyId}};
            const result = await admin.post(@{{ urlfor "CompanyContactController.Store" }}, data.field);
            if (result.status) {
                setTimeout(() => {
                    parent.location.reload();
                    layer.closeAll();
                }, 100)
            }
        });
    });
</script>